const { emailConfig } = require("../config/config.default.js");
var nodemailer = require("nodemailer");
var smtpTransport = nodemailer.createTransport({
  service: "163",
  auth: {
    user: emailConfig.username,
    pass: emailConfig.password,
  },
});
/**
 * 发送邮件
 */
function sendMail(to, subject, html, callback) {
  smtpTransport.sendMail(
    {
      from: "萌宠乐园<" + emailConfig.username + ">",
      to: to,
      subject: subject,
      html: html,
    },
    callback
  );
}
module.exports = sendMail;
